package com.nagornyi.uc.dao;

import com.nagornyi.uc.entity.Seat;
import com.nagornyi.uc.entity.Ticket;
import com.nagornyi.uc.entity.Trip;
import com.nagornyi.uc.entity.User;

import java.util.List;

/**
 * @author Nagorny
 * Date: 22.05.14
 */
public interface ITicketDAO extends DAO<Ticket> {

    int getFreeSeatsNumberForTrip(Trip trip);

    List<Seat> getUnavailableSeatsForTrip(Trip trip);

    List<Ticket> getTicketsForTrip(Trip trip);

    boolean sameTicketExists(Ticket newTicket);

    List<Ticket> getTicketsByUser(User user);

    void lockTicket(Ticket ticket);

    Ticket pollLockedTicket(String tripId, String ticketId);
}
